package com.soso.service;

import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.soso.entity.Roles;
import com.soso.entity.RolesSercher;

public interface RolesService {
	//多条件分页
      Page<Roles> findpage(RolesSercher rs,Integer page,Integer limit);
      //修改和添加
      Integer saveRoles(Roles r);
	Integer deleroles(Roles ro);
	 @Transactional
     @Modifying
     @Query(value="insert into roles(Id,Name) values(?1,?2)",nativeQuery=true)
     int adda(String Id,String name);
	 
	//多条件分页
 
     //修改和添加

     
	
	 //删除中间表
	 @Transactional
	 @Modifying
	 @Query(value="DELETE FROM rolemodules WHERE rolemodules.RoleId=?1",nativeQuery=true)
	 Integer deleteromoid(String aa);
	
	 //删除角色表
	 @Transactional
	 @Modifying
	 @Query(value="DELETE from roles WHERE roles.Id=?1",nativeQuery=true)
	 Integer deletero(String bb);
	 
	
}
